#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Intesim Python Script

Window.initCadWindow()
gl.Table('dt4e')
table = gl.tables['dt4e']
table.interpolationType = InterpolationType.Linear
table.extrapolationType = ExtrapolationType.BHType2
table.argument = 'H'
table.outPutName = 'B'
table.setData( ( 0, 238.7, 318.3, 358.1, 437.7, 477.5, 636.6, 795.8, 1114.1, 1273.2, 1591.5, 2228.2, 3183.1, 4774.6, 6366.2, 7957.7, 15915.5, 31831, 47746.5, 63662, 79577.5, 159155, 318310, ), ( 0, 0.2003, 0.3204, 0.40045, 0.50055, 0.5606, 0.7908, 0.931, 1.1014, 1.2016, 1.302, 1.4028, 1.524, 1.626, 1.698, 1.73, 1.87, 1.99, 2.04, 2.07, 2.095, 2.2, 2.4, ) )
gl.Material('air')
gl.materials['air'].addType(MaterialType.Magnetic_MUR)
gl.materials['air'].setValue(MaterialProperty.MURX, ValueType.Value,  1)
gl.materials['air'].setValue(MaterialProperty.MURY, ValueType.Value,  1)
gl.materials['air'].setValue(MaterialProperty.MURZ, ValueType.Value,  1)
gl.materials['air'].setValue(MaterialProperty.Density, ValueType.Value,  8.95e-06)
gl.Material('dt4e')
gl.materials['dt4e'].addType(MaterialType.Magnetic_MUR)
gl.materials['dt4e'].setValue(MaterialProperty.MURX, ValueType.Table,  1)
gl.materials['dt4e'].setValue(MaterialProperty.MURY, ValueType.Table,  1)
gl.materials['dt4e'].setValue(MaterialProperty.MURZ, ValueType.Table,  1)
gl.materials['dt4e'].setValue(MaterialProperty.Density, ValueType.Value,  2e-07)
gl.materials['dt4e'].removeType(MaterialType.IronLoss)
gl.materials['dt4e'].value(MaterialProperty.Density).value = 2e-07
gl.materials['dt4e'].addType(MaterialType.Thermal)
gl.materials['dt4e'].setValue(MaterialProperty.KZZ, ValueType.Value,  20000)
gl.materials['dt4e'].setValue(MaterialProperty.KYY, ValueType.Value,  20000)
gl.materials['dt4e'].setValue(MaterialProperty.KXX, ValueType.Value,  20000)
gl.materials['dt4e'].setValue(MaterialProperty.HCAPACITY, ValueType.Value,  460000000)
gl.materials['dt4e'].setValue(MaterialProperty.Density, ValueType.Value,  7.5e-06)
gl.Material('coil')
gl.materials['coil'].addType(MaterialType.Thermal)
gl.materials['coil'].setValue(MaterialProperty.KZZ, ValueType.Value,  380000)
gl.materials['coil'].setValue(MaterialProperty.KYY, ValueType.Value,  380000)
gl.materials['coil'].setValue(MaterialProperty.KXX, ValueType.Value,  380000)
gl.materials['coil'].setValue(MaterialProperty.HCAPACITY, ValueType.Value,  380000000)
gl.materials['coil'].addType(MaterialType.Electro_RSV)
gl.materials['coil'].setValue(MaterialProperty.RSVZ, ValueType.Value,  0.00019025)
gl.materials['coil'].setValue(MaterialProperty.RSVY, ValueType.Value,  0.00019025)
gl.materials['coil'].setValue(MaterialProperty.RSVX, ValueType.Value,  0.00019025)
gl.materials['coil'].addType(MaterialType.Magnetic_MUR)
gl.materials['coil'].setValue(MaterialProperty.MURX, ValueType.Value,  1)
gl.materials['coil'].setValue(MaterialProperty.MURY, ValueType.Value,  1)
gl.materials['coil'].setValue(MaterialProperty.MURZ, ValueType.Value,  1)
gl.materials['coil'].setValue(MaterialProperty.Density, ValueType.Value,  8.95e-06)
Model.updateSolverList()
Model.updateSolverList()
gl.Parameter('THICK', 8)
CAD.addParameter('THICK')
CAD.recomputeby('THICK')
gl.Parameter('DIST', 0)
CAD.addParameter('DIST')
CAD.recomputeby('DIST')
sketch = CAD.addSketch('sketch')
sketch.setRotation(0, 0, 0, 1)
CAD.getSketch('sketch').addPoint(CAD.Point(32, -31))
CAD.getSketch('sketch').addPoint(CAD.Point(3, -31))
CAD.getSketch('sketch').addPoint(CAD.Point(3, -20.5))
CAD.getSketch('sketch').addPoint(CAD.Point(5, -20.5))
CAD.getSketch('sketch').addPoint(CAD.Point(14.5, -11))
CAD.getSketch('sketch').addPoint(CAD.Point(14.5, -24))
CAD.getSketch('sketch').addPoint(CAD.Point(32, -24))
CAD.getSketch('sketch').addPoint(CAD.Point(32-%THICK%/2, -24))
CAD.getSketch('sketch').addPoint(CAD.Point(32-%THICK%/2, 23))
CAD.getSketch('sketch').addPoint(CAD.Point(15, 23))
CAD.getSketch('sketch').addPoint(CAD.Point(15, 23+%THICK%))
CAD.getSketch('sketch').addPoint(CAD.Point(32, 23+%THICK%))
CAD.getSketch('sketch').addPoint(CAD.Point(32, 23))
Model.updateSolverList()
Model.updateSolverList()
CAD.recompute()
CAD.getObject('sketch').label = 'fix'
sketch = CAD.addSketch('sketch001')
sketch.setRotation(0, 0, 0, 1)
CAD.getSketch('sketch001').addPoint(CAD.Point(17, -23))
CAD.getSketch('sketch001').addPoint(CAD.Point(25, -23))
CAD.getSketch('sketch001').addPoint(CAD.Point(25, 22))
CAD.getSketch('sketch001').addPoint(CAD.Point(17, 22))
Model.updateSolverList()
Model.updateSolverList()
CAD.getObject('sketch001').label = 'coil'
sketch = CAD.addSketch('sketch002')
sketch.setRotation(0, 0, 0, 1)
CAD.getSketch('sketch002').addPoint(CAD.Point(14.5, 46.5+%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(14.5, -4+%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(5, -13.5+%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(3, -13.5+%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(3, 26+%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(8, 31.5+%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(8, 46.5+%DIST%))
Model.updateSolverList()
Model.updateSolverList()
CAD.getObject('sketch002').label = 'armature'
sketch = CAD.addSketch('sketch003')
sketch.setRotation(0, 0, 0, 1)
CAD.getSketch('sketch003').addPoint(CAD.Point(0, -20.5))
CAD.getSketch('sketch003').addPoint(CAD.Point(5, -20.5))
CAD.getSketch('sketch003').addPoint(CAD.Point(14.5, -11))
CAD.getSketch('sketch003').addPoint(CAD.Point(14.5, 46.5))
CAD.getSketch('sketch003').addPoint(CAD.Point(0, 46.5))
Model.updateSolverList()
Model.updateSolverList()
CAD.getObject('sketch003').label = 'air'
Model.updateSolverList()
Model.updateSolverList()
CAD.getSketch('sketch').addLine(start = CAD.Point(3, -31), end = CAD.Point(3, -20.5), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.Start, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.End, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Vertical, geo_1='line1')
CAD.getSketch('sketch').addLine(start = CAD.Point(3, -20.5), end = CAD.Point(5, -20.5), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.Start, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.End, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch').addLine(start = CAD.Point(5, -20.5), end = CAD.Point(14.5, -11), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.Start, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.End, geo_2='vertex5', pos_2=PointPos.Start)
CAD.getSketch('sketch').addLine(start = CAD.Point(14.5, -11), end = CAD.Point(14.5, -24), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.Start, geo_2='vertex5', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.End, geo_2='vertex6', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Vertical, geo_1='line4')
CAD.getSketch('sketch').addLine(start = CAD.Point(14.5, -24), end = CAD.Point(32-%THICK%/2, -24), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line5', pos_1=PointPos.Start, geo_2='vertex6', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line5', pos_1=PointPos.End, geo_2='vertex8', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Horizontal, geo_1='line5')
CAD.getSketch('sketch').addLine(start = CAD.Point(32-%THICK%/2, -24), end = CAD.Point(32-%THICK%/2, 23), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line6', pos_1=PointPos.Start, geo_2='vertex8', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line6', pos_1=PointPos.End, geo_2='vertex9', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Vertical, geo_1='line6')
CAD.getSketch('sketch').addLine(start = CAD.Point(32-%THICK%/2, 23), end = CAD.Point(15, 23), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line7', pos_1=PointPos.Start, geo_2='vertex9', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line7', pos_1=PointPos.End, geo_2='vertex10', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Horizontal, geo_1='line7')
CAD.getSketch('sketch').addLine(start = CAD.Point(15, 23), end = CAD.Point(15, 23+%THICK%), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line8', pos_1=PointPos.Start, geo_2='vertex10', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line8', pos_1=PointPos.End, geo_2='vertex11', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Vertical, geo_1='line8')
CAD.getSketch('sketch').addLine(start = CAD.Point(15, 23+%THICK%), end = CAD.Point(32, 23+%THICK%), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line9', pos_1=PointPos.Start, geo_2='vertex11', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line9', pos_1=PointPos.End, geo_2='vertex12', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Horizontal, geo_1='line9')
CAD.getSketch('sketch').addLine(start = CAD.Point(32, 23+%THICK%), end = CAD.Point(32, -31), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line10', pos_1=PointPos.Start, geo_2='vertex12', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line10', pos_1=PointPos.End, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Vertical, geo_1='line10')
CAD.getSketch('sketch').addLine(start = CAD.Point(32, -31), end = CAD.Point(3, -31), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line11', pos_1=PointPos.Start, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line11', pos_1=PointPos.End, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Horizontal, geo_1='line11')
CAD.recompute()
CAD.getSketch('sketch001').addLine(start = CAD.Point(17, -23), end = CAD.Point(17, 22), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.Start, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.End, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Vertical, geo_1='line1')
CAD.getSketch('sketch001').addLine(start = CAD.Point(17, 22), end = CAD.Point(25, 22), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.Start, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.End, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Horizontal, geo_1='line2')
CAD.getSketch('sketch001').addLine(start = CAD.Point(25, 22), end = CAD.Point(25, -23), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.Start, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.End, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Vertical, geo_1='line3')
CAD.getSketch('sketch001').addLine(start = CAD.Point(25, -23), end = CAD.Point(17, -23), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.Start, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.End, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Horizontal, geo_1='line4')
CAD.recompute()
CAD.getSketch('sketch002').addLine(start = CAD.Point(3, -13.5+%DIST%), end = CAD.Point(5, -13.5+%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.Start, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.End, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Horizontal, geo_1='line1')
CAD.getSketch('sketch002').addLine(start = CAD.Point(5, -13.5+%DIST%), end = CAD.Point(14.5, -4+%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.Start, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.End, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addLine(start = CAD.Point(14.5, -4+%DIST%), end = CAD.Point(14.5, 46.5+%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.Start, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.End, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Vertical, geo_1='line3')
CAD.getSketch('sketch002').addLine(start = CAD.Point(14.5, 46.5+%DIST%), end = CAD.Point(8, 46.5+%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.Start, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.End, geo_2='vertex7', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addLine(start = CAD.Point(8, 46.5+%DIST%), end = CAD.Point(8, 31.5+%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line5', pos_1=PointPos.Start, geo_2='vertex7', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line5', pos_1=PointPos.End, geo_2='vertex6', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Vertical, geo_1='line5')
CAD.getSketch('sketch002').addLine(start = CAD.Point(8, 31.5+%DIST%), end = CAD.Point(3, 26+%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line6', pos_1=PointPos.Start, geo_2='vertex6', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line6', pos_1=PointPos.End, geo_2='vertex5', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addLine(start = CAD.Point(3, 26+%DIST%), end = CAD.Point(3, -13.5+%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line7', pos_1=PointPos.Start, geo_2='vertex5', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line7', pos_1=PointPos.End, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Vertical, geo_1='line7')
CAD.recompute()
CAD.getSketch('sketch003').addLine(start = CAD.Point(0, -20.5), end = CAD.Point(5, -20.5), construction = False)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.Start, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.End, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Horizontal, geo_1='line1')
CAD.getSketch('sketch003').addLine(start = CAD.Point(5, -20.5), end = CAD.Point(14.5, -11), construction = False)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.Start, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.End, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch003').addLine(start = CAD.Point(14.5, -11), end = CAD.Point(14.5, 46.5), construction = False)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.Start, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.End, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Vertical, geo_1='line3')
CAD.getSketch('sketch003').addLine(start = CAD.Point(14.5, 46.5), end = CAD.Point(0, 46.5), construction = False)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.Start, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.End, geo_2='vertex5', pos_2=PointPos.Start)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Horizontal, geo_1='line4')
CAD.getSketch('sketch003').addLine(start = CAD.Point(0, 46.5), end = CAD.Point(0, -13.5+%DIST%), construction = False)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Coincident, geo_1='line5', pos_1=PointPos.Start, geo_2='vertex5', pos_2=PointPos.Start)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Coincident, geo_1='line5', pos_1=PointPos.End, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch003').addConstraint(type=ConstraintType.Vertical, geo_1='line5')
CAD.recompute()
revolve = CAD.addRevolveAdvanced('revolve')
revolve.section = 'sketch'
revolve.dirtype = 'Pick'
revolve.dirshape = ('sketch003', 'Edge5')
revolve.reversed = False
revolve.pointtype = 'Link'
revolve.pointshape = ('sketch003', 'Edge5')
revolve.starttype = 'StartValue'
revolve.startdistance = 0
revolve.endtype ='EndValue'
revolve.enddistance = 360
revolve.solid = True
revolve.boolean = 'None'
revolve.generate()
CAD.getObject('sketch').setHide(True)
revolve = CAD.addRevolveAdvanced('revolve001')
revolve.section = 'sketch001'
revolve.dirtype = 'Pick'
revolve.dirshape = ('sketch003', 'Edge5')
revolve.reversed = False
revolve.pointtype = 'Link'
revolve.pointshape = ('sketch003', 'Edge5')
revolve.starttype = 'StartValue'
revolve.startdistance = 0
revolve.endtype ='EndValue'
revolve.enddistance = 360
revolve.solid = True
revolve.boolean = 'None'
revolve.generate()
CAD.getObject('sketch001').setHide(True)
revolve = CAD.addRevolveAdvanced('revolve002')
revolve.section = 'sketch002'
revolve.dirtype = 'Pick'
revolve.dirshape = ('sketch003', 'Edge5')
revolve.reversed = False
revolve.pointtype = 'Link'
revolve.pointshape = ('sketch003', 'Edge5')
revolve.starttype = 'StartValue'
revolve.startdistance = 0
revolve.endtype ='EndValue'
revolve.enddistance = 360
revolve.solid = True
revolve.boolean = 'None'
revolve.generate()
CAD.getObject('sketch002').setHide(True)
revolve = CAD.addRevolveAdvanced('revolve003')
revolve.section = 'sketch003'
revolve.dirtype = 'Pick'
revolve.dirshape = ('sketch003', 'Edge5')
revolve.reversed = False
revolve.pointtype = 'Link'
revolve.pointshape = ('sketch003', 'Edge5')
revolve.starttype = 'StartValue'
revolve.startdistance = 0
revolve.endtype ='EndValue'
revolve.enddistance = 360
revolve.solid = True
revolve.boolean = 'None'
revolve.generate()
CAD.getObject('sketch003').setHide(True)
Model.updateSolverList()
Model.updateSolverList()
cylinder = CAD.addCylinder('cylinder')
cylinder.radius = 100
cylinder.height = 160
cylinder.angle = 360
cylinder.x = 0
cylinder.y = 80
cylinder.z = 0
cylinder.rotationAngle = 1.5707963
cylinder.rotationZ = 0
cylinder.rotationY = 0
cylinder.rotationX = 1
Window.setView('fitView')

Model.updateSolverList()
Model.updateSolverList()
geomList = [['revolve', []]]
Mesh.createPartsComponent(comp_name = 'fix', geomNamelist = geomList)
geomList = [['revolve001', []]]
Mesh.createPartsComponent(comp_name = 'coil', geomNamelist = geomList)
geomList = [['revolve002', []]]
Mesh.createPartsComponent(comp_name = 'armature', geomNamelist = geomList)
geomList = [['revolve003', []]]
Mesh.createPartsComponent(comp_name = 'air2', geomNamelist = geomList)
geomList = [['cylinder', []]]
Mesh.createPartsComponent(comp_name = 'air1', geomNamelist = geomList)
Model.Model('model_1')
Model.models['model_1'].typeName = 'Electromagnetic (LF)'
Model.models['model_1'].importComponent('fix')
Model.models['model_1'].importComponent('coil')
Model.models['model_1'].importComponent('armature')
Model.models['model_1'].importComponent('air2')
Model.models['model_1'].importComponent('air1')
Model.updateSolverList()
Model.updateSolverList()
Model.models['model_1'].componentList.at(4).materialId = 1
Model.models['model_1'].componentList.at(3).materialId = 1
Model.models['model_1'].componentList.at(2).materialId = 2
Model.models['model_1'].componentList.at(0).materialId = 2
Model.models['model_1'].componentList.at(1).materialId = 3
bc = Model.BoundaryCondition()
bc.type = 'SourceCurrentDensity'
bc.compId = 2
bc.value('JSX').value = 0
bc.value('JSX').type = ValueType.Value
bc.value('JSY').value = 0
bc.value('JSY').type = ValueType.Value
bc.value('JSZ').value = 16000
bc.value('JSZ').type = ValueType.Value
Model.models['model_1'].bcList.append(bc)
Model.updateSolverList()
Model.updateSolverList()
Model.models['model_1'].solution.setValue(SolutionType.GaugeMethod, 3)
Model.models['model_1'].componentList.at(0).elementType = 'ELECTROMAGNETIC_Tet10'
Model.models['model_1'].componentList.at(1).elementType = 'ELECTROMAGNETIC_Tet10'
Model.models['model_1'].componentList.at(2).elementType = 'ELECTROMAGNETIC_Tet10'
Model.models['model_1'].componentList.at(3).elementType = 'ELECTROMAGNETIC_Tet10'
Model.models['model_1'].componentList.at(4).elementType = 'ELECTROMAGNETIC_Tet10'
Model.updateSolverList()
Model.updateSolverList()
part = CAD.addPartObj('group')
part.setShapeList (['revolve', 'revolve001', 'revolve002', 'revolve003', 'cylinder'])
part.concurrent = 1
Window.setView('fitView')
Mesh.setLocalSeed(part = 'revolve002', sub_list = [], size = 2)
Mesh.setLocalSeed(part = 'revolve001', sub_list = [], size = 2)
Mesh.setLocalSeed(part = 'revolve', sub_list = [], size = 2)
Mesh.setLocalSeed(part = 'revolve003', sub_list = [], size = 2)
holeDataList = []
Mesh.createSharedTopoMeshBand(listFullName = ['revolve.Solid1', 'revolve001.Solid1', 'revolve002.Solid1', 'cylinder.Solid1', 'revolve003.Solid1'], additionGeomList = [], bandFullName = [], holeList = holeDataList, bandMotionType = 0, sharedTopoMeshType = 3, elemType = 'ETri', order = 2, higherNodesOfType = 1, tolerance = 0)
Model.updateSolverList()
Model.updateSolverList()
Model.models['model_1'].solution.setValue(SolutionType.GaugeMethod, 0)
Model.models['model_1'].componentList.at(0).elementType = 'ELECTROMAGNETIC_Tet10'
Model.models['model_1'].componentList.at(1).elementType = 'ELECTROMAGNETIC_Tet10'
Model.models['model_1'].componentList.at(2).elementType = 'ELECTROMAGNETIC_Tet10'
Model.models['model_1'].componentList.at(3).elementType = 'ELECTROMAGNETIC_Tet10'
Model.models['model_1'].componentList.at(4).elementType = 'ELECTROMAGNETIC_Tet10'
component = Model.models['model_1'].componentList.at(0)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('fix')
component = Model.models['model_1'].componentList.at(1)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('coil')
component = Model.models['model_1'].componentList.at(2)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('armature')
component = Model.models['model_1'].componentList.at(3)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('air2')
component = Model.models['model_1'].componentList.at(4)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('air1')
gl.CoordSystem()
gl.coordSystems['gartesian_1'].type =  CSYSType.RotationalAxis
gl.coordSystems['rotationalaxis_1'].setPoint( 0, 0, 0, 0 )
gl.coordSystems['rotationalaxis_1'].setPoint( 1, 0, 1, 0 )
gl.coordSystems['rotationalaxis_1'].setPoint( 2, 0, 0, 0 )
bc = Model.models['model_1'].bcList.at(0)
bc.coordSysId = 1
bc.value('JSY').value = 5000
bc.value('JSZ').value = 0
gl.coordSystems['rotationalaxis_1'].pointAt(1).y = 0 
gl.coordSystems['rotationalaxis_1'].pointAt(1).z = 1 
gl.coordSystems['rotationalaxis_1'].pointAt(1).y = 1 
gl.coordSystems['rotationalaxis_1'].pointAt(1).z = 0 
Model.models['model_1'].removeComponent('fix')
Model.models['model_1'].removeComponent('armature')
Model.models['model_1'].removeComponent('air2')
Model.models['model_1'].removeComponent('air1')
Model.models['model_1'].bcList.removeAt(0)
Model.models['model_1'].removeComponent('coil')
Model.models['model_1'].importComponent('fix')
Model.models['model_1'].importComponent('coil')
Model.models['model_1'].importComponent('armature')
Model.models['model_1'].importComponent('air2')
Model.models['model_1'].importComponent('air1')
component = Model.models['model_1'].componentList.at(0)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('fix')
component = Model.models['model_1'].componentList.at(1)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('coil')
component = Model.models['model_1'].componentList.at(2)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('armature')
component = Model.models['model_1'].componentList.at(3)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('air2')
component = Model.models['model_1'].componentList.at(4)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('air1')
Model.models['model_1'].componentList.at(0).materialId = 2
Model.models['model_1'].componentList.at(1).materialId = 3
Model.models['model_1'].componentList.at(2).materialId = 2
Model.models['model_1'].componentList.at(3).materialId = 1
Model.models['model_1'].componentList.at(4).materialId = 1
bc = Model.BoundaryCondition()
bc.type = 'SourceCurrentDensity'
bc.compId = 2
bc.coordSysId = 1
bc.value('JSX').value = 0
bc.value('JSX').type = ValueType.Value
bc.value('JSY').value = 5000
bc.value('JSY').type = ValueType.Value
bc.value('JSZ').value = 0
bc.value('JSZ').type = ValueType.Value
Model.models['model_1'].bcList.append(bc)
Model.models['model_1'].removeComponent('fix')
Model.models['model_1'].removeComponent('coil')
Model.models['model_1'].removeComponent('armature')
Model.models['model_1'].removeComponent('air2')
Model.models['model_1'].removeComponent('air1')
del Model.models['model_1'] 
Model.Model('model_1')
Model.models['model_1'].typeName = 'Magnetic'
Model.models['model_1'].importComponent('fix')
Model.models['model_1'].importComponent('coil')
Model.models['model_1'].importComponent('armature')
Model.models['model_1'].importComponent('air2')
Model.models['model_1'].importComponent('air1')
component = Model.models['model_1'].componentList.at(0)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('fix')
component = Model.models['model_1'].componentList.at(1)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('coil')
component = Model.models['model_1'].componentList.at(2)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('armature')
component = Model.models['model_1'].componentList.at(3)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('air2')
component = Model.models['model_1'].componentList.at(4)
component.elementType = 'MAGNETIC_Tet10'
component.emagForceOutput = 1
component.emagForceCalculation = 2
Mesh.setComponentToElemType('air1')
Model.models['model_1'].componentList.at(0).materialId = 2
Model.models['model_1'].componentList.at(1).materialId = 3
Model.models['model_1'].componentList.at(2).materialId = 2
Model.models['model_1'].componentList.at(3).materialId = 1
Model.models['model_1'].componentList.at(4).materialId = 1
bc = Model.BoundaryCondition()
bc.type = 'SourceCurrentDensity'
bc.compId = 2
bc.coordSysId = 1
bc.value('JSX').value = 0
bc.value('JSX').type = ValueType.Value
bc.value('JSY').value = 5000
bc.value('JSY').type = ValueType.Value
bc.value('JSZ').value = 0
bc.value('JSZ').type = ValueType.Value
Model.models['model_1'].bcList.append(bc)
Window.setView('bottomView')
Window.setView('topView')
Window.setView('frontview')
CAD.deleteObject('Mesh')
Mesh.deleteSeed(part = 'revolve', sub_list = ['Vertex8', 'Vertex9'])
Mesh.deleteSeed(part = 'revolve', sub_list = ['Vertex1', 'Vertex2', 'Vertex3', 'Vertex4', 'Vertex5', 'Vertex6', 'Vertex7', 'Vertex8', 'Vertex9', 'Vertex10', 'Vertex11'])
Mesh.deleteSeed(part = 'revolve', sub_list = ['Face8'])
Mesh.setLocalSeed(part = 'revolve', sub_list = ['Edge13', 'Edge12'], size = 0.05)
holeDataList = []
Mesh.createSharedTopoMeshBand(listFullName = ['revolve.Solid1', 'revolve003.Solid1', 'cylinder.Solid1', 'revolve001.Solid1', 'revolve002.Solid1'], additionGeomList = [], bandFullName = [], holeList = holeDataList, bandMotionType = 0, sharedTopoMeshType = 3, elemType = 'ETri', order = 2, higherNodesOfType = 1, tolerance = 0)
